#ifndef __WATER_MODULE_H__
#define __WATER_MODULE_H__

#include "common.h"
#include "global_config.h"

/* Water quality sensor channels */
#define WATER_CHANNELS 2

/* ADC channels for water quality measurement */
#define WATER_ADC_CH1 4  /* ADC channel for water quality 1 */
#define WATER_ADC_CH2 5  /* ADC channel for water quality 2 */

/* Water quality message types */
typedef enum {
    WATER_MSG_DATA_READY = 1,
    WATER_MSG_CALIBRATION,
    WATER_MSG_RESISTANCE_READ
} water_msg_type_t;

/* Function declarations */
rt_err_t water_module_init(void);
void water_thread_entry(void *parameter);
float water_get_resistance(uint8_t channel);
float water_get_quality_value(uint8_t channel);
rt_err_t water_set_calibration(uint8_t channel, float k, float b);
rt_err_t water_set_cal_table(uint8_t channel, cal_point_t *table, uint8_t size);

/* External configuration access */
extern water_config_t *water_get_config(void);

#endif /* __WATER_MODULE_H__ */